package com.ruoyi.community.service.ec.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.community.mapper.EcFoodsMapper;
import com.ruoyi.community.domain.EcFoods;
import com.ruoyi.community.service.ec.IEcFoodsService;

/**
 * 社区电商Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-15
 */
@Service
public class EcFoodsServiceImpl implements IEcFoodsService
{
    @Autowired
    private EcFoodsMapper ecFoodsMapper;

    /**
     * 查询社区电商
     *
     * @param foodsId 社区电商ID
     * @return 社区电商
     */
    @Override
    public EcFoods selectEcFoodsById(Long foodsId)
    {
        return ecFoodsMapper.selectEcFoodsById(foodsId);
    }

    public List<EcFoods> selectEcFoodsListByRestaurantId(Long restaurantId){
        return ecFoodsMapper.selectEcFoodsListByRestaurantId(restaurantId);
    }
    /**
     * 查询社区电商列表
     *
     * @param ecFoods 社区电商
     * @return 社区电商
     */
    @Override
    public List<EcFoods> selectEcFoodsList(EcFoods ecFoods)
    {
        return ecFoodsMapper.selectEcFoodsList(ecFoods);
    }

    /**
     * 新增社区电商
     *
     * @param ecFoods 社区电商
     * @return 结果
     */
    @Override
    public int insertEcFoods(EcFoods ecFoods)
    {
        return ecFoodsMapper.insertEcFoods(ecFoods);
    }

    /**
     * 修改社区电商
     *
     * @param ecFoods 社区电商
     * @return 结果
     */
    @Override
    public int updateEcFoods(EcFoods ecFoods)
    {
        return ecFoodsMapper.updateEcFoods(ecFoods);
    }

    /**
     * 批量删除社区电商
     *
     * @param foodsIds 需要删除的社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcFoodsByIds(Long[] foodsIds)
    {
        return ecFoodsMapper.deleteEcFoodsByIds(foodsIds);
    }

    /**
     * 删除社区电商信息
     *
     * @param foodsId 社区电商ID
     * @return 结果
     */
    @Override
    public int deleteEcFoodsById(Long foodsId)
    {
        return ecFoodsMapper.deleteEcFoodsById(foodsId);
    }
}
